<?php $this->JQuery()->enable();?>
<script type="text/javascript">
$(function(){
	 
    // add multiple select / deselect functionality
    $("#selectall").click(function () {
          $('.case').attr('checked', this.checked);
    });
 
    // if all checkbox are selected, check the selectall checkbox
    // and viceversa
    $(".case").click(function(){
 
        if($(".case").length == $(".case:checked").length) {
            $("#selectall").attr("checked", "checked");
        } else {
            $("#selectall").removeAttr("checked");
        }
 
    });
});
</script>
<?php if(count($this->danhsach)>0){ ?>
<!--  start product-table ..................................................................................... -->
				<form id="mainform" action="" method="post">
				<table border="0" width="100%" cellpadding="0" cellspacing="0" id="product-table">
				<tr>
					<th class="table-header-check"><input type="checkbox" id="selectall"/></th>
					<th class="table-header-repeat line-left"><a href="">Mã học viên</a></th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Họ tên học viên</a></th>
					<th class="table-header-repeat line-left"><a href="">Năm sinh</a></th>
					<th class="table-header-repeat line-left minwidth-1"><a href="">Khóa học đăng ký</a></th>
					<th class="table-header-repeat line-left"><a href="">Ngày đăng ký</a></th>
					<th class="table-header-repeat line-left"><a href="">Buổi học</a></th>
					<th class="table-header-repeat line-left"><a href="">Ca học</a></th>
				</tr>
				
				
<?php

	foreach($this->danhsach as $danhsach)
	{
		$khoahocs = $danhsach->getKhoahoc();
		$hocvien = $danhsach->getHocvien();
		$id = $danhsach->getId();
		$mahocvien = $hocvien->getId();
		$tenhocvien = $hocvien->getTenhocvien();
		$namsinh = $hocvien->getNamsinh();
		$ngaydangky = $hocvien->getDate();
		$buoihoc = $danhsach->getBuoihoc();
		$cahoc = $danhsach->getCahoc();
		foreach($khoahocs as $khoahoc)
		{
			$tenkhoahoc = $khoahoc->getTenkhoahoc();
		}
?>
	<tr>
					<td><?php echo $this->formCheckbox('nhan'.$id,'1',array('class'=>'case'));?></td>
					<td><?php echo $mahocvien?></td>
					<td><?php echo $tenhocvien?></td>
					<td><?php echo $namsinh?></td>
					<td><?php echo $tenkhoahoc?></td>
					<td><?php echo $ngaydangky?></td>
					<td><?php echo $buoihoc?></td>
					<td><?php echo $cahoc?></td>					
				</tr>
<?php
		
}


?>
			</table>
			
			<?php echo $this->formSubmit('submit','Tiếp nhận')?>
				<!--  end product-table................................... -->
				</form>
				<?php }
				else {?>
				<h1>Không có học viên nào đăng ký!</h1>
				<?php }?>
				